/* 
get set 
就是vue的computed
 */

class Rect {
  late int height;
  late int width;
  Rect(this.height, this.width);

  get area {
    return this.height * this.width;
  }

  set areaHeight(value) {
    this.height = value;
  }
}

void main() {
  Rect r = new Rect(10, 4);
  print(r.area); // 触发get
  r.areaHeight = 6; // 触发set
  print(r.area); // 触发get
}
